package com.neusoft.jdmscloud.service.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.neusoft.jdmscloud.bean.Role;
import com.neusoft.jdmscloud.common.JdmsException;
import com.neusoft.jdmscloud.mapper.RoleMapper;

@Service
@Transactional(rollbackFor = JdmsException.class)
public class RoleServiceImpl implements RoleService {

	@Autowired
	private RoleMapper roleMapper;

	public List<Role> findRoles() {
		List<Role> list = new ArrayList<Role>();
		try {
			list = roleMapper.findRoles();
		} catch (RuntimeException e) {
			throw new JdmsException("查询角色异常", e);
		}
		return list;
	}

}
